<?php
/**
 * XmlRpc解码数组类
 *
 * @version $Id: XmlRpcArrayDecoder.php 312 2008-04-23 16:29:38Z iwind $
 * @package net.4kiki.rai.format.xmlrpc.decoder
 * @since 0.0.3
 */
class XmlRpcArrayDecoder extends AbstractXmlRpcDecoder {
	public function getValue() {
		$dom = new DOMDocument("1.0", $this->getCharset());
		$dom->loadXml($this->getXml());
		$array = array();
		$xpath = new DOMXPath($dom);
		$valueNodes = $xpath->query("/array/data/value/*");
		if ($valueNodes != null) {
			foreach ($valueNodes as $valueNode) {
				$rpcParamType = $valueNode->nodeName;
				$xml = $dom->saveXML($valueNode);
				$decoder = XmlRpcHelper::getDecoder($rpcParamType, $xml, $this->getCharset());
				$array[] = $decoder->getValue();
			}
		}
		return $array;
	}
}

?>